import { getStream } from '../Core/connect'
import { Object3D } from './Object3D'
import { Vector3 } from '../Math/Vector3'
import { Material } from '../Material/Material'
    // 正方形、管道
export class PixelLine extends Object3D {
    readonly type: string
    constructor(name: string) {
        super({name: name, type: 'PixelLine'})
        this.type = 'PixelLine'
    }
    // 点集构建管道(UE坐标)
    addPixelLineByList(pointList:Array<Vector3>) {
        const stream = getStream()
        const str = {PixelLineFunction: 'addPixelLineByList', ids: `${this.uuid}`, pointList:pointList}
        stream.emitUIInteraction(str)
    }
    // 修改线条宽度
    changePixelLineWidth(width: number) {
        const stream = getStream()
        const str = {PixelLineFunction: 'changePixelLineWidth', ids: `${this.uuid}`,width:width}
        stream.emitUIInteraction(str)
    }
    // 修改线条颜色
    changePixelLineRGB(material: Material) {
        const stream = getStream()
        const str = {PixelLineFunction: 'changePixelLineRGB', ids: `${this.uuid}`, Material: material}
        stream.emitUIInteraction(str)
    }
   // 修改点颜色
    changePointRGB(material: Material){
        const stream = getStream()
        const str = {PixelLineFunction: 'changePointRGB', ids: `${this.uuid}`, Material: material}
        stream.emitUIInteraction(str)
    }
    // 修改点大小
    changePointSize(size:number){
        const stream = getStream()
        const str = {PixelLineFunction: 'changePointSize', ids: `${this.uuid}`,size:size}
        stream.emitUIInteraction(str)
    } 
}